package com.hmall.feign.client;

import com.hmall.feign.dto.Address;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//设置feign客户端注解，参数是调用的 “服务名”
@FeignClient(value = "userservice")
public interface UserClient {
    /**
     * 根据addressId查询地址
     * @param id
     * @return Address
     */
    //注意：无论参数名是否一致都要设置参数别名
    @GetMapping("/address/{id}")
    Address getAddressById(@PathVariable("id") Long id);


}
